package dashboard

// period 枚举
type PERIOD string

func (p PERIOD) String() string {
	return string(p)
}

const (
	DAY   PERIOD = "day"
	MONTH PERIOD = "month"
	YEAR  PERIOD = "year"
)

// Comparison 数据数量，同比，环比
type Comparison struct {
	Num      int64   `json:"total"`
	OnRate   float32 `json:"on_rate"`
	OverRate float32 `json:"over_rate"`
}
type Wave struct {
	Total    int64   `json:"total"`
	Quantity []int64 `json:"quantity"`
}

type UserBoardResponse struct {
	User       int64      `json:"user,omitempty"`
	BindUser   int64      `json:"bind_user,omitempty"`
	UnbindUser int64      `json:"unbind_user,omitempty"`
	ShareUser  int64      `json:"share_user,omitempty"`
	Day        Comparison `json:"day"`
	Month      Comparison `json:"month"`
	Year       Comparison `json:"year"`
}

type UserWaveResponse struct {
	Period      PERIOD `json:"period,omitempty"`
	OwnedBike   Wave   `json:"owned_bike"`
	UnownedBike Wave   `json:"unowned_bike"`
}

type UserComplaintBoardResponse struct {
	Complaint int64      `json:"complaint,omitempty"`
	Day       Comparison `json:"day"`
	Month     Comparison `json:"month"`
	Year      Comparison `json:"year"`
}

type UserComplaintWaveResponse struct {
	Period    PERIOD `json:"period,omitempty"`
	Complaint Wave   `json:"complaint"`
}

type ActiveUserBoardResponse struct {
	TopActive int64      `json:"top_active,omitempty"`
	Day       Comparison `json:"day"`
	Month     Comparison `json:"month"`
	Year      Comparison `json:"year"`
}

type ActiveUserWaveResponse struct {
	Period     PERIOD `json:"period,omitempty"`
	ActiveUser Wave   `json:"active_user"`
}

type UserSummaryResponse struct {
	Total  int64 `json:"total,omitempty"`
	Bind   int64 `json:"bind,omitempty"`
	Share  int64 `json:"share,omitempty"`
	Unbind int64 `json:"unbind,omitempty"`
}
